package com.rmi;

import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;

public class Client {
	public static void main(String[] args) {

		try {
			Registry registry = LocateRegistry.getRegistry("localhost", 2004);
			UserManagerInterface userManager = (UserManagerInterface) registry.lookup("userManager");
			System.out.println(
					"" + userManager.getAdminAccount().getUsername() + userManager.getAdminAccount().getPassword());
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (NotBoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}
}

//因为先前启动过一次,再rmi注册中心有记录了,换个端口就行了.jdk自带的注册中心